package com.itheima.HomeWork.homework01;

import java.util.ArrayList;

public class Test00 {
    public static void main(String[] args) {
        ArrayList<String> list1 = new ArrayList<>();
        ArrayList<Person> list2 = new ArrayList<>();
        ArrayList<Student> list3 = new ArrayList<>();
        ArrayList<JavaStudent> list4 = new ArrayList<>();
        ArrayList<UIStudent> list5 = new ArrayList<>();
        ArrayList<Teacher> list6 = new ArrayList<>();
        ArrayList<JavaTeacher> list7 = new ArrayList<>();
        ArrayList<UITeacher> list8 = new ArrayList<>();
        print1(list1);
        print2(list2);
        print3(list3);
        print4(list4);
    }

    //要求：参数可以接收任何泛型的ArrayList参数
    private static void print1(ArrayList<?> s) {
        System.out.println("参数可以接收任何泛型的ArrayList参数");
    }

    //要求：参数可以接收任何Person及其子类泛型的ArrayList参数
    private static void print2(ArrayList<? extends Person> s) {
        System.out.println("参数可以接收任何Person及其子类泛型的ArrayList参数");
    }

    //要求：参数可以接收任何Student及其子类泛型的ArrayList参数
    private static void print3(ArrayList<? extends Student> s) {
        System.out.println("参数可以接收任何Student及其子类泛型的ArrayList参数");
    }

    //要求：参数可以接收任何Java学员，及其父类泛型的ArrayList参数
    private static void print4(ArrayList<? extends JavaStudent> s) {
        System.out.println("参数可以接收任何Java学员，及其父类泛型的ArrayList参数");
    }
}


class Person {
}

class Student extends Person {
}

class JavaStudent extends Student {
}

class UIStudent extends Student {
}

class Teacher extends Person {
}

class JavaTeacher extends Teacher {
}

class UITeacher extends Teacher {
}